<?php

use app\commands\Mytools;


$this->title = '数据统计';
$this->registerJsFile('@web/assets/apache-echarts-5.2.2/dist/echarts.js', ['position' => \yii\web\View::POS_HEAD]);
?>

<style type="text/css">
    #tables {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }

    #tables div.pane {
        background-color: #abcdef;
        border-radius: 5px;
        padding: 13px 3px;
        flex: 1;
        margin: 1em;
        min-width: 400px;
    }

    #tables div.pane .title {
        height: 30px;
        line-height: 20px;
        padding-left: 20px;
        font-weight: 800;
    }

    #tables div.pane .content {
        background-color: #fff;
    }

    #tables div.pane .content table {
        width: 100%;
    }

    #tables div.pane .content td {
        border-bottom: #ddd 1px solid;
        border-left: #ddd 1px solid;
        text-align: center;
        padding: 0.4em;
    }
</style>

<div id="balance" style="width:100%;margin:1em 0;">

    <div id="tables">
        <div class="pane">
            <div class="title">班次统计</div>
            <div class="content">
                <table>
                    <tr style="background-color: #d8e4bc;">
                        <td width="60">班次</td>
                        <td width="60">时间</td>
                        <?php if (null != $workgroup && count($workgroup) > 0) {
                            foreach ($workgroup as $name) { ?>
                                <td width="50"><?= $name ?></td>
                        <?php }
                        } ?>
                        <td width="60">总计</td>
                    </tr>
                    <?php if (null != $data && count($data) > 0) {
                        foreach ($data as $time => $value) {
                            foreach ($value as $type => $v) { ?>
                                <tr>
                                    <td><?= $type ?></td>
                                    <td><?= $time ?></td>
                                    <td>预约<?= $ten_days[date('Y-m-d', strtotime(' - 1 day'))]['order'] ?></td>
                                    <td>到诊<?= $ten_days[date('Y-m-d', strtotime(' - 1 day'))]['arrive'] ?></td>
                                    <td>未到<?= $ten_days[date('Y-m-d', strtotime(' - 1 day'))]['should_arrive'] - $ten_days[date('Y-m-d', strtotime(' - 1 day'))]['arrive'] ?></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                    <?php }
                        }
                    } ?>
                </table>
            </div>
        </div>
        <div class="pane">
        </div>
    </div>

</div>

<script type="text/javascript">
    var chartDom = document.getElementById('recent_ten_month');
    var myChart = echarts.init(chartDom);
    var option;

    option = {

    };

    option && myChart.setOption(option);
</script>